/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package dieci.utils;

/**
 *
 * @author patobl
 */
public class Redondeo {
    
    public static double Redondear(double numero,int digitos)
    {
        int cifras=(int) Math.pow(10,digitos);
        return Math.rint(numero*cifras)/cifras;
    }
    
    public static float Redondear(float numero,int digitos)
    {
        int cifras=(int) Math.pow(10,digitos);
        return (float) (Math.rint(numero*cifras)/cifras);
    }
}
